<template>
	<div>
		<el-form>
			<div style="height: 20px;display:flex;align-items: center;justify-content: center;margin-top: 20px;">
				<span style="height: 20px;line-height: 20px;font-size: 20px;margin-bottom: 20px;">请输入要删除的公告编号:</span>
			</div>

			<el-input style="width: 40%;margin-left: 30%;margin-right: 30%;" v-model="inputId"></el-input>
		</el-form>
		<el-button type="primary" @click.prevent="deleteNotice()">提交</el-button>
	</div>
</template>

<script>
	import request from '../../utils/axios/request'
	export default {

		data() {
			return {
				inputId: ''
			}
		},
		methods: {
			deleteNotice() {
				alert('确定要删除公告编号为' + this.inputId + '的公告信息吗')
				request({
					method: 'delete',
					url: '/notice/' + this.inputId,
				}).then(res => {
					console.log(res)
					if (res.data.code == 100) {
						alert('删除成功')
					} else if (res.data.code == 101) {
						alert('删除失败，不存在该编号的设备')
					}
				})
			}
		}
	}
</script>

<style>
</style>